<?php
defined('_JEXEC') or die;
include 'includes/viewitem.php';
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
$text = $params->get('leading_text');
?>

	<?php if ($this->item->featured && $this->params->get('show_leading_label')):?>
    	<div class="leadingItemLabel">Featured</div>
	<?php endif;?>
    
	<?php if ($thumb && $this->params->get('show_leading_image')):?>
	<div class="leadingItemImage">    	
		<a href="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid)); ?>">
			<?php echo $thumb;?>
	    </a>    	  	
    </div>
	<?php endif;?>      
	
    <h1 class="leadingItemTitle">
		<a href="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid)); ?>">
			<?php echo $this->escape($this->item->title); ?>			
        </a>       
    </h1>
	
    <?php if ($params->get('show_leading_date') || $params->get('show_leading_category') || $params->get('show_leading_author') ) : ?>
    <div class="leadingItemInfo">
        <?php if ($params->get('show_leading_date')) : ?>
        <span class="leadingItemDate"><?php echo JText::sprintf(JHtml::_('date',$this->item->created, JText::_('DATE_FORMAT_LC3'))); ?></span>
        <?php endif; ?>
        <?php if ($params->get('show_leading_category')) : ?>
        <span class="leadingItemCat">
            <?php $title = $this->escape($this->item->category_title);
                        $url = '<a href="' . JRoute::_(ContentHelperRoute::getCategoryRoute($this->item->catid)) . '">' . $title . '</a>'; ?>               
             <?php echo JText::sprintf($url); ?>            
        </span>
        <?php endif; ?>  
        <?php if ($params->get('show_leading_author') && !empty($this->item->author )) : ?>
        <span class="leadingItemAuthor">
        <?php $author =  $this->item->author; ?>
            <?php $author = ($this->item->created_by_alias ? $this->item->created_by_alias : $author);?>
    			<?php echo JText::sprintf($author); ?>
               
   		 </span>
        <?php endif; ?>
    </div>
    <?php endif;?>

    
<?php if ($params->get('show_intro')) : ?>
	<div class="leadingItemSapo">
    	<?php if($sapo):?>
    		<?php echo $sapo;?>
        <?php else :?>        	
            <?php echo mb_substr(strip_tags(JHtml::_('content.prepare', $this->item->introtext)),0, $text, 'UTF-8'); if (strlen(strip_tags(JHtml::_('content.prepare', $this->item->introtext)))>$text) echo '...'; ?>
        <?php endif;?>
    </div>
<?php endif; ?>

	<?php if ($params->get('show_leading_readmore')) : ?>
    	<a href="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid)); ?>">
			Readmore			
        </a>  
    <?php endif; ?>
	<div class="clr"></div>



